﻿@{
    ViewBag.Title = "上传限制编辑";
    Layout = "~/Views/Shared/_EditLayout.cshtml";
}
@using TjZheng.Domain.DataEntity;
@inherits CMSWebViewPage<UploadLimit>
<div class="top-block">
    @CurrentButtonTool.Create()
</div>
<div>
    <form id="fr_uploadlimit" method="post">
        @*@Html.AntiForgeryToken()*@
        <table class="tblContent">
            <colgroup>
                <col class="colTitle">
                <col class="colContent" />
            </colgroup>
            <tr>
                <td><span class="txtNoNull">*</span>名称:</td>
                <td>
                    @Html.Hidden("objProvide.Id", Model.Id, false)
                    @Html.StringBox("objProvide.Name", Model.Name, true, "请输入名称", null, ValidType.Length(64))
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>保存方式:</td>
                <td>
                    @Html.RadioButtonList("objProvide.SaveType", Model.SaveType, new List<SelectListItem>
                    {
                        new SelectListItem{Text="本地服务器",Value="0"},
                        new SelectListItem{Text="远程服务器",Value="1"},
                        new SelectListItem{Text="云存储",Value="2"}
                    })
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>媒体类型:</td>
                <td>
                    @Html.RadioButtonList("objProvide.MediaType", Model.MediaType, new List<SelectListItem>
                    {
                        new SelectListItem{Text="图片",Value="0"},
                        new SelectListItem{Text="文件",Value="1"}
                    })
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>资源类型:</td>
                <td>
                    @Html.StringBox("objProvide.UcCode", Model.UcCode, true, "请输入资源类型", new { @readonly = "readonly" }, null, ValidType.Length(64))
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>限制类型:</td>
                <td>
                    @Html.StringBox("objProvide.LimitCode", Model.LimitCode, true, "请输入限制类型", null, ValidType.Length(64))
                </td>
            </tr>
            <tr>
                <td>远程存储IP:</td>
                <td>
                    @Html.StringBox("objProvide.ServerIP", Model.ServerIP, false, "请输入远程存储IP", null, ValidType.Length(256))
                </td>
            </tr>
            <tr>
                <td>远程访问地址:</td>
                <td>
                    @Html.StringBox("objProvide.ServerPath", Model.ServerPath, false, "请输入远程访问地址", null, ValidType.Length(256))
                </td>
            </tr>
            <tr>
                <td>用户名:</td>
                <td>
                    @Html.StringBox("objProvide.UserName", Model.UserName, false, "请输入用户名", null, ValidType.Length(64))
                </td>
            </tr>
            <tr>
                <td>用户密码:</td>
                <td>
                    @Html.StringBox("objProvide.Password", Model.Password, false, "请输入用户密码", new { type = "password" }, null, ValidType.Length(64))
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>资源类型Id:</td>
                <td>
                    @Html.NumberBox("objProvide.UcId", Model.UcId, new { @readonly = "readonly" })
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>限制大小:</td>
                <td>
                    @Html.NumberBox("objProvide.LimitSize", Model.LimitSize, null)
                    K（0为不限制）
                </td>
            </tr>
            <tr>
                <td><span class="txtNoNull">*</span>限制扩展名:</td>
                <td>
                    @Html.StringBox("objProvide.LimitExtension", Model.LimitExtension, true, "请输入限制扩展名", null, ValidType.Length(256))
                    （ *.jpg;*.jpeg; *.png;*.gif;*.bmp）
                </td>
            </tr>
        </table>
    </form>
</div>
@section Bottom{
    <script type="text/javascript">
        function Save() {
            var objFormEntity = new FormEntity("#fr_uploadlimit");
            objFormEntity.url = "/uploadlimit/save/";
            objFormEntity.submiting = function () {
                return $(objFormEntity.selector).form('validate');
            };
            objFormEntity.submitSuccess = function (InvokeResult) {
                if (InvokeResult.ResultCode == "Success") {
                    ShowMessage(InvokeResult.ResultMessage);
                    Back();
                } else {
                    ShowMessage(InvokeResult.ResultMessage);
                }
            };
            objFormEntity.isClearData = false;
            objFormEntity.submit();
        }
        function Back() {
            TransferToUrl("/uploadlimit");
        }
    </script>
}
